<%-- 
    Document   : chitietsanpham
    Created on : 30-09-2011, 01:02:07
    Author     : Mr-Nguyen
--%>

<%@page import="DAO.cuahangDAO"%>
<%@page import="DatabasePOJO.cuahang"%>
<%@page import="java.util.ArrayList"%>
<%@page import="DAO.sanphamDAO"%>
<%@page import="DatabasePOJO.sanpham"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%
    ArrayList<sanpham> sp = (ArrayList<sanpham>)session.getAttribute("ctsp");
    String dnb = sp.get(0).getDiemNoiBat();
    String dkad = sp.get(0).getDieuKienApDung();
    String mact = sp.get(0).getMaChiTiet();
    cuahang ch = cuahangDAO.getCuaHang(sp.get(0).getMaCuaHang());

%>

<table width="100%" height="100%" border="0">
           <!-- Lập lại cho các sản phảm-->
          <tr>
            <td height="105" valign="top">
            <!-- BAt Dau-->
            <table width="100%" border="0">
          <tr>
            <td colspan="2" background="Images/backmenu.gif">
                <a href="index.jsp?Action=chitiet&MaSanPham=<%= sp.get(0).getMaSanPham() %>&ThaoLuan=true"> Tham gia thảo luận</a>
            | 0 ý kiến.
            </td>
            </tr>
          <tr style="background-image:url(Images/backngang.gif)">
            <td width="43%" align="center">
            Điểm nổi bật
            </td>
            <td width="50%" align="center">
            Điều kiện áp dụng
            </td>
          </tr>
          <tr style="background-color: mistyrose">
              <td height="217" valign="top" ><%= dnb %></td>
              <td valign="top"><%= dkad %></td>
          </tr>
          <tr>
            <td colspan="2" background="Images/backngang.jpg">
                 <%
                    if(request.getParameter("ThaoLuan") == null){
                    %>
                    Thông tin chi tiết
                    <%}
                    else
                    {%>
                    Thảo luận về sản phẩm
       <%             }
    %>
            </td>
            </tr>
          <tr>
            <td height="137" colspan="2" valign="top">
            <table width="100%" border="0" >
              <tr>
                <td valign="top" width="80%" height="320" style="background-color: mistyrose">
                    <%
                    if(request.getParameter("ThaoLuan") == null){
                    %>
                    <%= mact %>
                    <%}
                    else
                    {%>
                    <jsp:include page="thaoluan.jsp" >
                        <jsp:param name="masp" value="<%= sp.get(0).getMaSanPham() %>"/>
                    </jsp:include>
       <%             }
    %>
                </td>
                <td width="20%" valign="top" background="Images/backtable.gif">
                    <p><%= ch.getTenCuaHang() %></p>
                    <p><a href="<%= ch.getWebsite() %>" target="_bank"> Ghé thăm website </a></p>
                    <p>Địa chỉ: <%= ch.getDiaChi() %></p>
                </td>
              </tr>
            </table></td>
            </tr>
         
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
        </table>
            </td>
          </tr>
</table>
            <!--Ket thuc-->           <!-- Ket thuc lập lại cho sản phẩm-->